/******************************************************************************
 * STRUCTURE:   struct _PAINTER_T_
 * DESCRIPTION: 
 * MEMBERS:
 *  color - 
 *  size  - 
 *  x     - 
 *  y     - 
 ******************************************************************************/
typedef struct _PAINTER_T_
{
	unsigned short color;
	unsigned short size;
	unsigned short x;
	unsigned short y;
}PAINTER_T;

PAINTER_T gs500_painter;

#define IMG_W 240
#define IMG_H 320

/******************************************************************************
 * FUNCTION:    image_set_pen
 *
 * DESCRIPTION: 
 *              
 * Inputs:      
 *              unsigned short color
 *              unsigned short size
 * Outputs:     
 *              
 * Return:      
 *              
 * Notes:       
 *              
 ******************************************************************************/
void image_set_pen(unsigned short color, unsigned short size)
{
	gs500_painter.color=color;
	gs500_painter.size=size;
}

/******************************************************************************
 * FUNCTION:    image_move_pen
 *
 * DESCRIPTION: 
 *              
 * Inputs:      
 *              unsigned short x
 *              unsigned short y
 * Outputs:     
 *              
 * Return:      
 *              
 * Notes:       
 *              
 ******************************************************************************/
void image_move_pen(unsigned short x, unsigned short y)
{
	gs500_painter.x=x;
	gs500_painter.y=y;
}

/******************************************************************************
 * FUNCTION:    image_draw_point
 *
 * DESCRIPTION: 
 *              
 * Inputs:      
 *              unsigned short *frame
 *              unsigned short x
 *              unsigned short y
 * Outputs:     
 *              
 * Return:      
 *              
 * Notes:       
 *              
 ******************************************************************************/
void image_draw_point(unsigned short *frame, unsigned short x, unsigned short y)
{
	int xx,yy,off;

	if (x>0) x--;
	if (y>0) y--;

	frame+=IMG_W*y+x;

	for (yy=y; yy<320; yy++)
	{
		for (xx=x; xx<240; xx++)
			*frame++=gs500_painter.color;
		
		frame+=IMG_W-1;
	}
}

